Field of the Invention
The present disclosure relates to a message execution server that executes a process based on a message in a queue, and a control method.
Description of the Related Art
As a service that provides various applications operating in a server on the Internet, there is a cloud service. In a cloud service such as IaaS and PaaS, a cloud service vender provides a system administrator resources including a virtual machine that operates in a server computer in a data center over the Internet or a storage. The virtual machine is a logical computer that divides, using a virtual technique, the server in logical units without considering its physical configuration and operates with an independent operating system provided in the respective divided server. The system administrator can establish a system to provide an original service by using the resources including the virtual machine and the storage, which are provided by the cloud service vender.
In the system established by using the cloud service, a message queue (hereinafter, referred to as a queue) may be used to execute a process data asynchronously or periodically. In the queue, a message corresponding to process target data is stored. The virtual machine having a function to process the message acquires the message stored in the queue and executes a process according to a process content described in the message.
Japanese Patent Laid-Open No. 2015-72716 describes a mechanism to control to increase or reduce a number of instances that execute a process based on a message, according to a number of messages stored in a queue.
In a system that uses the above described queue, the time needed for the process of one message may differ depending on the process content of the message. Accordingly, there may be a case that the message execution server (instance) is occupied for a long period of time for a process of a message having a long process time and the start of a process of another message registered in the queue is delayed.
In the above described mechanism of Japanese Patent Laid-Open No. 2015-72716, when the number of messages stored in the queue is equal to or greater than a defined value, the number of the instances for executing the process based on the message increases. However, in a case that the process of each message acquired by the instances takes a long period of time, this results in a process of other message which may be delayed.